/**
 * 其他玩家手牌
 */
class OtherHand extends MyHand {
	public revCard: eui.Image;
	public handGroup: eui.Group;

	public constructor() {
		super();
	}

	public childrenCreated(): void {}

	/**收到手牌 */
	public receiveHandCard(): void {
		this.revCard.visible = true;
	}
	/**隐藏收到手牌 */
	public hideReceiveCard(): void {
		this.revCard.visible = false;
	}

	public deletePeng(d: PengItem): void {
		var cards = 0;
		if(d.type != MjLogic.Prio.Gang){
			cards = 3;
		}
		for (let i = 0; i < cards; i++) {
			for (let j = 0; j < 13; j++) {
				var card = (this.handGroup.getChildByName(j.toString()) as eui.Image);
				if (card.visible) {
					card.visible = false;
					break;
				}
			}
		}
	}

	public setCardByNumber(num: number): void {
		for (var i = 0; i < 13; i++) {
			if (i >= (13 - num)) {
				(this.handGroup.getChildByName(i.toString()) as eui.Image).visible = true;
			} else {
				(this.handGroup.getChildByName(i.toString()) as eui.Image).visible = false;
			}
		}
	}

}